﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
				   assembly="AspZone.Commerce.Core"
				   namespace="AspZone.Commerce.Model">

  <class name="Product" table="[dbo].[Product]">

    <id name="Id">
      <column name="ProductId" not-null="true" />
      <generator class="identity" />
    </id>

    <property name="Name" />
    <property name="SEOName" />
    <property name="ShortDescription" />
    <property name="LongDescription" />
    <property name="SEOTitle" />
    <property name="SEOKeywords" />
    <property name="Price" />
    <property name="DiscountPercent" />
    <property name="HandlingCharge" />
    <property name="Weight" />
    <property name="QuantityAvailable" />

    <bag name="Images" cascade="all">
      <key column="[ProductId]" />
      <one-to-many class="Image" />
    </bag>

    <bag name="Categories" table="[dbo].[ProductCategory]">
      <key column="[ProductId]" />
      <many-to-many column="[CategoryId]" class="Category" />
    </bag>

    <bag name="Properties" cascade="all">
      <key column="[ProductId]" />
      <one-to-many class="ProductProperty" />
    </bag>

  </class>
</hibernate-mapping>
